using System;
using Gtk;
using Subsync.Core.Sync;
using Subsync.CLI;

namespace Subsync.GUI
{
	/// <summary>
	/// Author: Steven Goh Jian Wen with some modifications by Tsz Lai
	/// </summary>
	public partial class MainWindow : Gtk.Window
	{
        //Constructor
		public MainWindow () : base(Gtk.WindowType.Toplevel)
		{
			this.Build ();
			this.Decorated = false;
			this.Resizable = false;
			
			Config cfg = new Config ();
			this.CreateFrames ();
			this.ShowAll ();
			this.DeleteEvent += HandleHandleDeleteEvent;
			this.Icon = new Gdk.Pixbuf (System.IO.Path.Combine (new Config ().GetProperty ("ImageStoragePath"), "logo1.png"));
		}
	
		private void CreateFrames ()
		{
			Gdk.Color bgcolour = new Gdk.Color (69, 69, 69);
			GlossyRoundedFrame sframe = new GlossyRoundedFrame ();
			sframe.DrawFill = true;
			sframe.DrawFrame = true;
			sframe.FillColor = bgcolour;
			sframe.FrameColor = bgcolour;
			sframe.FillAlpha = 0.9;
			sframe.FrameAlpha = 0.2;
			sframe.Radius = 0;
			sframe.GlossHeight = 0;
			
			SimpleFrame coresimple = new SimpleFrame ();
			sframe.Add (coresimple);
			
			this.vbox1.Add (sframe);
		}

		void HandleHandleDeleteEvent (object o, Gtk.DeleteEventArgs args)
		{
			Gtk.Application.Quit();
		}
	}
}
